From the hub, tagged: "Best practices"

Easily QuickCheck your predicates

This post is external to PrologHub

Logtalk lgtunit testing tool includes a QuickCheck implementation supporting property-based testing of plain Prolog, Prolog module, and Logtalk code. The tool is portable and can be used with all Logtalk supported Prolog compilers. The QuickCheck implementation provides ...


Failure-driven loops: when and how

This post is external to PrologHub

Failure is a big part of logic programming success! (always wanted to write this :-)

Predicates are often required to perform repetitive operations. For example, assume a table of...


Multifile predicates: dos and don'ts

This post is external to PrologHub

Multifile predicates are a standard Logtalk and Prolog feature. The name multifile originates from being able to define a predicate in multiple files. Multifile predicates are declared ...


DCGs provide a threading state abstraction: don't break it

This post is external to PrologHub

Definite Clause Grammars (DCGs) provide a useful threading state abstraction with countless applications in Logtalk and Prolog programming. But programmers sometimes break this abstraction without realizing it and for no benefit. This usually happens when ...